package qnb.dao;

import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author huangxin
 * @date 2019/5/30-15:48
 */
public interface StatisticsMapper {
    @Select("select s.teacher_id name,count(*) y from  student s where time_of_enrollment  >=DATE_SUB(CURDATE(), INTERVAL 1 MONTH) group by s.teacher_id;"
            )
    List<Map<String ,Object >> statisticsStudentGrade();

    @Select("select  teacher_name from  teacher where  teacher_id = #{id}")
    String findTeacherName(String id);

    @Select("SELECT DATE_FORMAT(time_of_enrollment,'%m') as name,count(*)y  FROM student where time_of_enrollment>  DATE_SUB(CURDATE(), INTERVAL 1 YEAR) group by  name")
    List<Map<String ,Object>> statisticsStudentIn();
}
